package org.jeecg.modules.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.ApiLoginUser;
import org.jeecg.common.util.RedisUtil;

import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Objects;

/**
 * @author guoyh
 * @ClassName BaseController
 * @Description
 * @since 2020/8/14 00:49
 **/
@Slf4j
public class BaseController {

    protected ApiLoginUser getLoginUser(){
        return (ApiLoginUser) SecurityUtils.getSubject().getPrincipal();
    }

    protected String getOpenId(){
//        getLoginUser().setOpenid("oRBzQs-tc5pXR8oaHMYGEt2qNqYw");
//        return getLoginUser().getOpenid();
        return "oRBzQs-tc5pXR8oaHMYGEt2qNqYw";
    }

    protected String getWxUserinfoId(){
        return getLoginUser().getId();
    }

}
